/*
 * @Author: Lu junwen
 * @Date: 2022-03-13 18:14:37
 * @LastEditors: Lu junwen
 * @LastEditTime: 2022-05-19 02:53:09
 * @FilePath: \vue-shop-app-customer\src\store\index.js
 */
import Vue from 'vue'
import Vuex from 'vuex'
import VuexPersist from 'vuex-persist'
// 引入注册模块
import register from './register/register'
// 引入用户模块
import user from './user/user'
// 引入栏目管理模块
import category from './category/category'
// 引入产品管理模块
import product from './product/product'
import shopcart from './Shopcart/shopcart'
//引入查询订单模块
import order from "./order/order";
//引入查询订单详情模块
import orderdetail from "./orderdetail/orderdetail"
// 引入地址模块
import address from "./address/address"

import search from "./search/search"


Vue.use(Vuex)
const vuexPersist = new VuexPersist({
  key: 'vuex',
  storage: window.sessionStorage
})
export default new Vuex.Store({
  plugins: [vuexPersist.plugin],
  state: {
  },
  mutations: {
  },
  actions: {
  },
  modules: {
    // 注册模块
    register,
    // 用户模块
    user,
    // 栏目模块
    category,
    // 产品模块
    product,
    shopcart,
    //查询订单详情模块
    orderdetail,
    //查询订单模块
    order,
    // 地址模块
    address,
    // 查询商品模块
    search
  }
})
